import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:moose_app/ui/values/values.dart';

class ATHAddressReceivingItem extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(bottom: kSize30),
      padding: EdgeInsets.symmetric(vertical: kSize10, horizontal: kSize20),
      constraints: BoxConstraints(maxHeight: kSize250),
      decoration: kCommonBoxDecoration,
      child: Column(
        children: [
          Flexible(
            child: Row(
              children: [
                SvgPicture.asset(
                  "assets/icons/icon_trophy.svg",
                  width: kSize48,
                ),
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left: kSize20),
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.end,
                          children: [
                            Text(
                              "江景",
                              style: TextStyle(
                                  fontSize: kSize34,
                                  fontWeight: FontWeight.bold),
                            ),
                            Text(
                              "18973738399",
                              style:
                                  TextStyle(fontSize: kSize28, color: kColor99),
                            )
                          ],
                        ),
                        ExtendedText.rich(
                            TextSpan(children: <TextSpan>[
                              BackgroundTextSpan(
                                  text: " 默认 ",
                                  background: Paint()..color = kColorF1,
                                  style: TextStyle(color: kColorFF5000)),
                              BackgroundTextSpan(
                                  text: " 家  ",
                                  background: Paint()..color = kColorF1,
                                  style: TextStyle(color: kColor99)),
                              TextSpan(text: "北京市 朝阳区 东三环中路39号 建外SOHO广场"),
                            ]),
                            maxLines: 2,
                            textHeightBehavior:
                                TextHeightBehavior.fromEncoded(20),
                            overflow: TextOverflow.ellipsis,
                            style: TextStyle(fontSize: kFontSize30)),
                      ],
                    ),
                  ),
                ),
                SvgPicture.asset(
                  "assets/icons/icon_edit.svg",
                  width: kSize28,
                ),
              ],
            ),
          ),
          Divider(),
          Container(
            height: kSize60,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Row(
                  children: [
                    SvgPicture.asset(
                      "assets/icons/icon_location.svg",
                      width: kSize48,
                    ),
                    Container(
                        margin: EdgeInsets.only(left: kSize8),
                        child: Text("默认地址"))
                  ],
                ),
                Text("删除")
              ],
            ),
          )
        ],
      ),
    );
  }
}
